import { createStore, combineReducers, applyMiddleware } from 'redux'

import reducers from './reducers'
import thunk from 'redux-thunk'

export default createStore(
  combineReducers(reducers),
  {
    trainNumber: null,
    departStation: null,
    arriveStation: null,
    seatType: null,
    departDate: Date.now(),
    arriveDate: Date.now(),
    departTimeStr: null,
    arriveTimeStr: null,
    durationStr: null,
    price: null,
    passengers: [
      {
        id: -1,
        name: '小明',
        ticketType: 'adult',
        licenceNo: '123456',
        seat: 'Z',
      },
      {
        id: -2,
        name: '小寒',
        gender: 'male',
        birthday: '20001010',
        followAdult: -1,
        ticketType: 'child',
        seat: 'Z',
      },
    ],
    menu: null,
    isMenuVisible: false,
    searchParsed: false,
  },
  applyMiddleware(thunk)
)
